mkdir -p ~/podman/db/init
mkdir -p ~/podman/db/data

cp ./db_init/* ~/podman/db/init/

podman network create sorani

podman run -d \
  --name db \
  --network sorani \
  -e POSTGRES_PASSWORD=8520 \
  -v ~/podman/db/init/:/docker-entrypoint-initdb.d/ \
  -v ~/podman/db/data/:/var/lib/postgresql/data/ \
  postgres

podman pod create --name server --network sorani:alias=server

mkdir -p ~/podman/ctapi/config
cp ./api/config.toml ~/podman/ctapi/config/config.toml
mkdir -p ~/podman/ctapi/data
mkdir -p ~/podman/ctapi/data/log
podman run -d \
  --name ctapi \
  --pod server \
  -e RUST_LOG=trace \
  -v ~/podman/ctapi/config/:/root/.config/ctapi/ \
  -v ~/podman/ctapi/data/:/root/.local/share/ctapi/ \
  localhost/ctapi \
  --db postgres://beargod:8520@db:5432/api